﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Photon.SocketServer;
using ExitGames.Logging;
using Lite;
using Lite.Caching;
using Lite.Operations;
using KylinstarMahjong.Operations;
namespace KylinstarMahjongServer
{
    class MahjongPeer : Lite.LitePeer
    {
        private static readonly ILogger log = LogManager.GetCurrentClassLogger();
        public MahjongPeer(InitRequest InitRequest)
            : base(InitRequest)
        { }

        protected override RoomReference GetRoomReference(JoinRequest joinRequest)
        {
            return MahjongRoomCache.Instance.GetRoomReference(joinRequest.GameId, this);
        }
        protected override void OnOperationRequest(OperationRequest operationRequest, SendParameters sendParameters)
        {
            if (log.IsDebugEnabled)
            {
                log.DebugFormat("OnOperationRequest. Code={0}", operationRequest.OperationCode);
            }
            base.OnOperationRequest(operationRequest, sendParameters);
        }
    }
}
